<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 200px;
            height: 200px;
            background-color: skyblue;
            position: absolute;
            /*
            animation 用来定义动画
            @keyframes 用来定义动画的关键帧
            animation-name: 动画名
            animation-duration: 动画持续时间
            animation-delay: 动画延迟时间
            animation-timing-function: 动画速度曲线
            animation-fill-mode: 动画填充模式
            animation-iteration-count: 动画次数
            animation-direction: 动画播放方向
            animation-play-state: 动画播放状态

            以上的内容，可以合成一个简写：
            animation: name duration timing-function delay iteration-count direction fill-mode play-state;
            */
            /* animation-name: boxMove;
            animation-duration: 3s;
            animation-delay: 2s;
            animation-timing-function: linear;
            animation-fill-mode: forwards;
            animation-iteration-count: 3;
            animation-direction: alternate;
            animation-play-state: paused; */

            animation: boxMove 3s linear 2s 3 forwards alternate running;
        }

        @keyframes boxMove {
            0% {
                left: 0;
                top: 0;
                background-color: skyblue;
            }
            30%{
                left: 0;
                top: 500px;
            }
            60% {
                left: 500px;
                top: 500px;
            }

            100%{
                left: 500px;
                top: 0px;
                background-color: red;
            }
        }
    </style>
</head>

<body>
    <div class="box"></div>
</body>

</html>